<?
 session_start();
 require("connect.php"); 
?>
<html><!-- InstanceBegin template="/Templates/sodaubaitemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="Javascript" src="scripts/innovaeditor.js"></script>
<link rel="stylesheet" type="text/css" href="css/engine.css" />
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<script language="javascript" type="text/javascript" src="js/datetimepicker.js">
</script>
</head>
<body>
<table align="center" width="938" cellpadding="0" cellspacing="0" border="0">
	<tr><td colspan="2" height="26" bgcolor="#CCCCCC">
	<? $malop=$_REQUEST["mal"];
	$resu99=mysql_query("select * from lop where mal='{$malop}'");
		$row99=mysql_fetch_array($resu99);
	?>	
	<!--Menu 1-->
	<div id="tool">

	<a href="index.php">Trang chủ trường</a>
		 | 
		  <a href="hotrohoctap.php">Hỗ trợ học tập</a>
		  |		
		<a href="lienhe.php">Liên hệ</a>
	</div>
	<!--het menu 1-->
	</td></tr>
	<tr><td colspan="2" height="34" bgcolor="#CCCCCC">
	<div id="menuwrapper">
		<ul id="p7menubar">
			 <li><a class="trigger" href="lopcuatoi.php?mal=<? echo $malop;?>" target="_self">Trang chủ <? echo $row99["tenl"];?></a></li>										  	
		  <li class="linemenus"></li>					 
		  <li>
		  <?
		  	if ($_SESSION["login"]!=true){
		  ?>		  
		  <a class="trigger" href="login.php" target="_self">Trang cá nhân</a>
		  <? } else {
		  		if($_SESSION["quyen"]==0) {
		  ?>	
		   			<a class="trigger" href="admin/index.php" target="_self">Trang cá nhân</a>
		  		<? } else if($_SESSION["quyen"]==1) {?>
					<a class="trigger" href="giaovien.php?magv=<? echo $_SESSION["username"];?>" target="_self">Trang cá nhân</a>
				<? } else if($_SESSION["quyen"]==2) {?>
					<a class="trigger" href="trangphuhuynh.php?maph=<? echo $_SESSION["username"];?>&mal=<? echo $malop;?>" target="_self">Trang cá nhân</a>
				<? } else if(($_SESSION["quyen"]==3) || ($_SESSION["quyen"]==4)) {?>
					<a class="trigger" href="tranghocsinh.php?mahs=<? echo $_SESSION["username"];?>&mal=<? echo $malop;?>" target="_self">Trang cá nhân</a>
				<? }?>
		  		
		  <? }?>
		  <!--bat dau phan dang nhap-->
		  <?
				if ($_SESSION["login"]!=true){
			?>
			 <li class="linemenus"></li>					 
		  	 <li><a class="trigger" href="login.php" target="_self">Đăng nhập</a>			
			<? }else{?>
			 <li class="linemenus"></li>					 
		  	 <li><a class="trigger" href="logout.php" target="_self">Thoát</a>			
			 <li class="linemenus"></li>
			 <li><a class="trigger">
			 	<?
		$nguoidung=$_SESSION["username"];
		if($_SESSION["quyen"]==0){
		$resu23=mysql_query("select * from admin where maadmin='{$nguoidung}'");
		$row23=mysql_fetch_array($resu23);
		?>
			<font color="#FFFFFF">			 
			<? echo "Xin chào : ".$row23["hotendem"]."&nbsp;".$row23["ten"]; ?>
			</font>
		<? }else if($_SESSION["quyen"]==1){
			$resu23=mysql_query("select * from giaovien where magv='{$nguoidung}'");
			$row23=mysql_fetch_array($resu23);
		?>
			<font color="#FFFFFF">			 
			<? echo "Xin chào : ".$row23["hotendem"]."&nbsp;".$row23["ten"]; ?>
			</font>
		<? }else if($_SESSION["quyen"]==2){
			$resu23=mysql_query("select * from phuhuynh where maph='{$nguoidung}'");
			$row23=mysql_fetch_array($resu23);
		?>
			<font color="#FFFFFF">			 
			<? echo "Xin chào : ".$row23["tenph"]; ?>
			</font>
		<? }else if(($_SESSION["quyen"]==3)||($_SESSION["quyen"]==4)){
				$resu23=mysql_query("select * from hocsinh where mahs='{$nguoidung}'");
				$row23=mysql_fetch_array($resu23);
		?>
			<font color="#FFFFFF">			 
			<? echo "Xin chào : ".$row23["hotendem"]."&nbsp;".$row23["ten"]; ?>
			</font>
		<? }
	}?>
		  <!--het-->		 
		</ul>
	</div>
	</td></tr>
	<tr>
		<td width="160px" height="800" valign="top">
		<!--menu trai-->		
		<table align="center" width="100%" border="1" cellpadding="0" cellspacing="0">
		<tr><td valign="middle" height="30">
			<a href="sodaubai.php?mal=<? echo $malop;?>"><img src="anh/sodaubai.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="sodaubai.php?mal=<? echo $malop;?>">Sổ đầu bài</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="danhsachhocsinh.php?mal=<? echo $malop;?>"><img src="anh/user.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="danhsachhocsinh.php?mal=<? echo $malop;?>">Danh sách học sinh</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="thuvienanhlop.php?mal=<? echo $malop;?>.php"><img src="anh/album.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="thuvienanhlop.php?mal=<? echo $malop;?>">Thư viện ảnh</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="lopcuatoi_baiviet.php?mal=<? echo $malop;?>"><img src="anh/baiviet.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="lopcuatoi_baiviet.php?mal=<? echo $malop;?>">Bài viết</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="thoikhoabieu.php?mal=<? echo $malop;?>"><img src="anh/thoikhoabieu.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="thoikhoabieu.php?mal=<? echo $malop;?>">Thời khóa biểu</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="thongbaolop.php?mal=<? echo $malop;?>"><img src="anh/thongbao.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="thongbaolop.php?mal=<? echo $malop;?>">Thông báo</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="tailieulop.php?mal=<? echo $malop;?>""><img src="anh/tailieu.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="tailieulop.php?mal=<? echo $malop;?>">Tài liệu Upload</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="xemdiemlop.php?mal=<? echo $malop;?>""><img src="anh/xemdiem.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="xemdiemlop.php?mal=<? echo $malop;?>">Xem điểm</a>
		</td></tr>			
		</table>
		<!-- het menu trai-->
	</td>
		
    <td align="center" valign="top"><!-- InstanceBeginEditable name="EditRegion3" -->	
	<?
		$ngay=$_REQUEST["ngay"];
		$mal=$_REQUEST["mal"];
		$result=mysql_query("select * from sodaubai where mal='{$mal}' and ngay='{$ngay}' order by tiethoc");			
	?>
	<!--Begin -->
		<table align="right" width="99%" cellpadding="1" cellspacing="1" border="0">
		<tr>
			<td align="center">
			<!--Begin tieu de-->
				<div class="sodaubai">
					<div class="gift_quatang_topblog">
						<p class="gift_quatang_fl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_fl_right"><img src="anh/space.gif"></p>
					</div>
					<div class="noidungsodaubai">
						<h1></h1>
							<font size="+2" color="#003366">
								Sổ đầu bài lớp <? 
								$result2=mysql_query("select * from lop where mal='{$mal}'");
								$r2=mysql_fetch_array($result2);
								echo $r2["tenl"];
								?>	
							</font>																		 
						<div class="gift_quatang_mView">
							<span style="float:left; width:100px;"> 
							</span>
							<span style=" float: right;">
												 <font color="#476da4">
												 </font>			
							</span>
						</div>
					</div>
					<div class="gift_quatang_btmblog">
						<p class="gift_quatang_bl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_bl_right"><img src="anh/space.gif"></p>
					</div>			
				</div>
			<!--End tieu de-->
			<div class="sodaubai">
					<div class="gift_quatang_topblog">
						<p class="gift_quatang_fl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_fl_right"><img src="anh/space.gif"></p>
					</div>
					<div class="noidungsodaubai">
						<h1 align="left"><font color="#cc3333"> Ngày <? echo $ngay;?></font></h1>
						<table align="center" cellpadding="4" cellspacing="0" border="0" width="98%">
							<? while($r=mysql_fetch_array($result)){?>
								<tr><th colspan="2" align="left" bgcolor="#EEEEEE"><font color="#003366">Tiết <? echo $r["tiethoc"];?></font></th></tr>									
								<tr>															
								<th align="left" width="180px">Môn học	:</th>
								<td><?	
									$result2=mysql_query("select * from monhoc where mamh='{$r["mamh"]}'");
									if(mysql_num_rows($result2)<=0)
									{
										echo $r["mamh"];
									}else {
										$r2=mysql_fetch_array($result2);
										echo $r2["tenmh"];
									}
							?></td>
						</tr>						
						<tr>
								<th align="left">Bài học :</th>
								<td><? echo $r["baihoc"];?></td>
						</tr>																	
						<tr>
							<th align="left">Nhận xét của giáo viên :</th>
							<td><? echo $r["nhanxet"];?></td>
						</tr>
						<tr>
							<th align="left">Sĩ số :</th>
							<td><?
								$result6=mysql_query("select * from hocsinh where mal='{$r["mal"]}'");
								$n=mysql_num_rows($result6);
								$n1=$n-$r["hsvang"];
								echo $n1;echo " / ";echo $n;echo " học sinh"
							?></td>
						</tr>						
						<tr>
							<th align="left">Học sinh vắng :</th>
							<td>
								<?
									$result3=mysql_query("select * from hocsinh where mal='{$r["mal"]}'");
									while($r3=mysql_fetch_array($result3)){
										$result4=mysql_query("select * from chuyencan where mahs='{$r3["mahs"]}' and ngay='{$r["ngay"]}' and tiet='{$r["tiethoc"]}' and chuyencan!=3");
										while($r4=mysql_fetch_array($result4)){
											$result5=mysql_query("select * from hocsinh where mahs='{$r4["mahs"]}'");
											if(mysql_num_rows($result5)<=0)
											{
												echo $r4["mahs"];
												echo ",&nbsp;";
											}else {
											$r5=mysql_fetch_array($result5);
												echo $r5["hotendem"];echo "&nbsp;";echo $r5["ten"];
												echo ",&nbsp;";
											}
										}
									}
								?>
							</td>
						</tr>
						<tr>
							<th align="left">Xếp loại :</th>
							<td>
								<?								
									if($r["xeploai"]==1)
									{  
										echo "Tốt";
									}else if($r["xeploai"]==2)
									{  
										echo "Khá";
									}else if($r["xeploai"]==3)
									{  
										echo "Trung bình";
									}else if($r["xeploai"]==4)
									{  
										echo "Yếu";
									}else if($r["xeploai"]==5)
									{
										echo "Kém";
									}
								?>
							</td>
						</tr>							
						<tr>
								<th align="left">Giáo viên :</th>						
								<td><?
									$result1=mysql_query("select * from giaovien where magv='{$r["magv"]}'");
									$r1=mysql_fetch_array($result1);
									echo $r1["hotendem"];echo "&nbsp;";echo $r1["ten"];
								?></td>
						</tr>					
							<? }?>
						</table>	
						<div class="sodaubai_bottom">
							<span style="float:left; width:100px;">												
							</span>
							<span style=" float: right;">
												 <font color="#476da4">
								
												 </font>			
							</span>
						</div>
					</div>
					<div class="gift_quatang_btmblog">
						<p class="gift_quatang_bl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_bl_right"><img src="anh/space.gif"></p>
					</div>			
				</div>
			<!--End so dau bai theo ngay-->	
				
			</td>
		</tr>
		</table>
	<!--End-->	
	<!-- InstanceEndEditable --></td>
	
	</tr>
	<tr><td colspan="2" align="center" valign="middle" bgcolor="#999999" height="100">Phạm Đức Đóa - Khoa CNTT - Đại học Xây Dựng</td></tr>
</table>
</body>
<!-- InstanceEnd --></html>
